#include "TcpServer.hpp"
#include <memory>

using namespace tcpServer;

static void usage(std::string proc)
{
    std::cerr << "Usage:\n\t" << proc << "port"
              << "\n\n";
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port = atoi(argv[1]);

    std::unique_ptr<TcpServer> tsvr(new TcpServer(port));

    tsvr->InitServer();
    tsvr->Dispatcher();

    return 0;
}